//
//  ShowItem2.m
//  HYHOME
//
//  Created by Mac on 16/1/27.
//  Copyright © 2016年 Mac. All rights reserved.
//

#import "ShowItem2.h"
#import "ModelImage.h"
#import "NetworkingHandle.h"



@interface ShowItem2 ()<UIWebViewDelegate>
@property (nonatomic,retain)ModelImage *model;
@property(nonatomic,retain)UIWebView *webView;

@end

@implementation ShowItem2



- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    

    CGRect frame = self.view.frame;
    
    self.webView = [[UIWebView alloc ]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(frame), CGRectGetHeight(frame))];
    
    self.webView.backgroundColor = [UIColor whiteColor];
    
    self.webView.userInteractionEnabled =YES;
    
    self.webView.opaque = NO;
    
    [self.view addSubview:self.webView];
    [self.webView release];
    
    
    NSString *str1 =  [NSString stringWithFormat:@"http://yyjd.xinzhuzhang.com/m/jiaju/goods/detail?id=%@&appid=881376723&channel=AppleStore2&token=&udid=852f2d86c0414900d4b72ef95c09ccf6d39d87c2", self.ida];
    
    
    [NetworkingHandle networkingWithURL:str1 completeHandel:^(NSURLResponse *response, NSData *data, id result1) {
        
        NSDictionary *dic2 = [result1 objectForKey:@"goods"];
        
        NSString *url = [dic2 objectForKey:@"url"];
        
        
        
        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
    }];
    

    
    
    
    

}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
